<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>v-for指令</title>
</head>

<body>
    <div id="app">
        <ul>
            <li v-for="(name,i) in names">{{i+1}} - {{name}}</li>
        </ul>
    </div>
</body>

</html>
<script src="https://cdn.bootcss.com/vue/2.6.11/vue.min.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            names: ["xiaocang", "xiaoze", "xiaolong"]
        }
    })
</script>